<extend name="Public:common"/>
<block name="css">
    <style>
        <link rel="stylesheet" href="__STATIC__/layui/css/layui.css"  media="all">
        .left{width:20%; vertical-align: middle;}
        .right{text-align:left;}
        label{padding:10px 0 10px 15px;}
    </style>
</block>
<block name="content">
    <div class="container-fluid">
        <div class="tabbable">
            <ul class="nav nav-tabs padding-12 tab-color-blue background-blue" id="myTab">
                <li class="active" ><a href="#">目的地城市</a></li>
            </ul>
            <div class="row" style="padding:10px;">
                <span style="cursor:pointer;margin-right:10px;" class="btn btn-primary pull-right" onclick="choseOk();">已经选好</span>
            </div>
            <div class="tab-content">
                <table class="table table-striped table-bordered table-hover table-condensed text-center">
                    <tbody>
                    <volist name="cityList" id="vo">
                        <tr>
                            <td class="col-md-2 col-xs-2 text-center">
                                <label for="chk_{$vo.areaId}">{$vo.areaName}</label>
                                <!--<input type="checkbox" class="chk" id="chk_{$vo.areaId}" value="{$vo.areaId}">-->
                            </td>
                            <td class="col-md-10 col-xs-10 text-left">
                                <label >{$co.areaName}</label>
                                <!--<input type="checkbox" class="chk" id="chk_{$co.areaId}" value="{$co.areaId}">-->
                                <table class="table table-striped table-bordered table-hover table-condensed text-center">
                                    <tbody>
                                    <volist name="vo['child']" id="co">
                                        <tr>
                                            <td class="col-md-2 col-xs-2 text-center">
                                                <label >{$co.areaName}</label>
                                                <!--<input type="checkbox" class="chk" id="chk_{$vo.areaId}" value="{$vo.areaId}">-->
                                            </td>
                                            <td class="col-md-10 col-xs-10 text-left">
                                                <volist name="co['child']" id="cco">
                                                    <label for="chk_{$cco.areaId}">{$cco.areaName}</label>
                                                    <input type="checkbox" class="chk" id="chk_{$cco.areaId}" value="{$cco.areaId}">
                                                </volist>
                                            </td>
                                        </tr>
                                    </volist>
                                    </tbody>
                                </table>
                            </td>
                        </tr>
                    </volist>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</block>
<block name="js">
    <script type="text/javascript" src="__STATIC__/layer/layer.js"></script>
    <script>
        function choseOk(){
            var choseCity=[];
            $('.chk').each(function () {
                if($(this).is(':checked')){
                    var item={name:$(this).prev().text(),value:$(this).val()};
                    choseCity.push(item);
                }
            });
            if(choseCity.length<=0){
                layer.msg('请选择目的地城市!');
                return false;
            }

            parent.callbackDestinationCity(JSON.stringify(choseCity));
        }
    </script>
</block>